package com.cskt.petproject178.controller;
import com.cskt.petproject178.pojo.param.CommodityListParam;
import com.cskt.petproject178.pojo.vo.CommentVO;
import com.cskt.petproject178.pojo.vo.PageVO;
import com.cskt.petproject178.pojo.vo.ResultVO;
import com.cskt.petproject178.service.CommentProductParamService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * 评论控制器
 *
 * @author 27013
 **/

@RestController
@RequestMapping(value = "/pms")
public class CommentController {
    @Resource
    private CommentProductParamService commentProductParamService;

    @GetMapping(value = "/comment/commentList")
    public ResultVO<PageVO<CommentVO>> selectCommentParam(@RequestParam(value ="spuId") Long spuId, @RequestParam(value = "isPic", required = false) Integer isPic,
        @RequestParam(value = "pageNo") Integer pageNo) {
       Integer pageSize =20;
        return ResultVO.OK(commentProductParamService.selectCommentParam(spuId, isPic, (pageNo-1)*pageSize, pageSize));
    }
}
